﻿/*
 * Range 范围
 */

var data = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
Console.WriteLine(string.Join(",", data[..4])); //不包含索引 4 
Console.WriteLine(string.Join(",", data[3..9]));
Console.WriteLine(string.Join(",", data[^3..]));
Console.WriteLine(string.Join(",", data[..^3]));
Console.WriteLine(string.Join(",", data[2..^3]));
Console.WriteLine(string.Join(",", data[^3..^2]));
